package com.shoppingmall.fragment;

import android.view.View;

import com.allen.library.SuperTextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.zyh.toolslib.base.BaseFragment;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.shoppingmall.R;
import com.shoppingmall.bean.DealersBean;

import java.util.ArrayList;
import java.util.List;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;

/**
 * 2020/3/15
 * 描述：我的经销商明细里他的经销商
 */
public class DealerSubordinateDealersDetailsFragment extends BaseFragment {

    @BindView(R.id.rv_content_list)
    RecyclerView rvContentList;
    @BindView(R.id.smart_refresh)
    SmartRefreshLayout smartRefresh;
    private List<DealersBean> mData = new ArrayList<>();
    private BaseQuickAdapter<DealersBean, BaseViewHolder> mAdapter;

    @Override
    protected void initView(View rootView) {

    }

    @Override
    protected void initData() {
        for (int i = 0; i < 5; i++) {
            mData.add(new DealersBean("18235899625", "150"));
        }
        mAdapter = new BaseQuickAdapter<DealersBean, BaseViewHolder>(R.layout.item_mine_my_dealers, mData) {
            @Override
            protected void convert(@NonNull BaseViewHolder helper, DealersBean item) {
                SuperTextView superTextView = (SuperTextView) helper.itemView;
                superTextView.setLeftString(item.getAccountNumber());
                superTextView.setRightString("重消币：" + item.getConsumeCoins());
            }
        };
        rvContentList.setLayoutManager(new LinearLayoutManager(mActivity));
        rvContentList.setAdapter(mAdapter);
    }

    @Override
    protected int initLayout() {
        return R.layout.fragment_recycleview;
    }
}
